package com.project.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.Valid;

/**
 * @ProjectName:
 * @Package:
 * @ClassName:
 * @Author: ZhaoLongShi
 * @CreateDate:
 */

/**
 * 用户表
 */
@Data
@TableName(value = "`user`")
@Valid
public class User {


    /**
     * 主键ID
     */
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    private Long userId;

    /**
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "`password`")
    private String password;

    /**
     * 手机号码
     */
    @TableField(value = "phone")
    private Long phone;

    /**
     * 会员 0表示不是会员，1表示一级会员
     */
    @TableField(value = "vip")
    private Integer vip;

    /**
     * 头像
     */
    @TableField(value = "img_url")
    private String imgUrl;

    /**
     * 注册时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "register_time")
    private Date registerTime;

    /**
     * 积分
     */
    @TableField(value = "integral")
    private Integer integral;

    /**
     * 余额
     */
    @TableField(value = "balance")
    private Double balance;

    /**
     * 账号是否可用 0不可用，1可用
     */
    @TableField(value = "is_del")
    private Integer isDel;

    public static final String COL_USER_ID = "user_id";

    public static final String COL_USERNAME = "username";

    public static final String COL_PASSWORD = "password";

    public static final String COL_PHONE = "phone";

    public static final String COL_VIP = "vip";

    public static final String COL_IMG_URL = "img_url";

    public static final String COL_REGISTER_TIME = "register_time";

    public static final String COL_INTEGRAL = "integral";

    public static final String COL_BALANCE = "balance";

    public static final String COL_IS_DEL = "is_del";
}